//
//  KDFocusRequestTool.m
//  YuQingXiaoFang
//
//  Created by wangdongdong on 18/6/15.
//  Copyright © 2018年 KDTech. All rights reserved.
//

#import "KDFocusRequestTool.h"
#import "KDBaseTool.h"

#import "KDFocusListParam.h"
#import "KDBaseResult.h"
#import "KDFocusListResult.h"
@implementation KDFocusRequestTool
/**   资讯列表 */
+ (void)getFocusListWithParam:(KDFocusListParam *)param success:(void (^)(KDFocusListResult *responseObejct))success failure:(void(^)(NSError *error))failure{
    param.method = @"appNewsAttent/list.do";
    NSString *url = [NSString stringWithFormat:@"%@%@",FrontServiceAddr,param.method];
    [KDBaseTool get:url param:param resultClass:[KDFocusListResult class] success:success failure:failure];
}
/**  添加关注的请求 */
+ (void)addFocusWithParam:(KDFocusListParam *)param success:(void (^)(KDBaseResult *responseObejct))success failure:(void(^)(NSError *error))failure{
    NSString *url = [NSString stringWithFormat:@"%@%@",FrontServiceAddr,@"appNewsAttent/add"];
    NSDictionary *params = [param keyValues];
    [KDBaseTool post:url bodyJson:params resultClass:[KDBaseResult class] success:success failure:failure];
}
/**  取消关注的请求 */
+ (void)cancelFocusWithParam:(KDFocusListParam *)param success:(void (^)(KDBaseResult *responseObejct))success failure:(void(^)(NSError *error))failure{
    param.method = @"appNewsAttent/delete";
    NSString *url = [NSString stringWithFormat:@"%@%@",FrontServiceAddr,param.method];
    [KDBaseTool get:url param:param resultClass:[KDBaseResult class] success:success failure:failure];
}


@end
